<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>类式组件</title>
</head>
<script src="./js/react.development.js"></script>
<script src="./js/react-dom.development.js"></script>
<!-- 引入 babel  将jsx语法 转换为 js语法 -->
<script src="./js/babel.min.js"></script>

<body>
    <div id="root"></div>
    <script type="text/babel">
        class H1 extends React.Component {
            
            render() {
                return <h1>我是一个h1</h1>
            }
        }
        class H2 extends React.Component {
            render() {
                return <h2>我是一个h1</h2>
            }
        }
        class App extends React.Component {
            
            render() {
                return <div>
                    <H1></H1>
                    <H2></H2>
                </div>
            }
        }

        ReactDOM.render(<App />, document.getElementById("root"))

    </script>
</body>

</html>